package com.heima.mapper;

import com.github.pagehelper.Page;
import com.heima.pojo.SkuClass;
import com.heima.pojo.dto.SkuClassPageDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SkuClassMapper {

    Page<SkuClass> pageQuery(SkuClassPageDTO skuClassPageDTO);

    @Insert("insert into tb_sku_class (class_name, parent_id) values (#{className}, #{parentId})")
    void insert(SkuClass skuClass);

    @Delete("delete from tb_sku_class where class_id = #{classId}")
    void delete(Integer classId);


    void update(SkuClass skuClass);

    @Select("select * from tb_sku_class where class_id = #{classId}")
    SkuClass queryById(Integer classId);
}
